package cn.zmall.sso.service;


import cn.zmall.manager.dto.OrderDto;
import cn.zmall.manager.dto.ThanksDto;
import cn.zmall.manager.dto.front.Order;
import cn.zmall.manager.dto.front.OrderList;
import cn.zmall.manager.dto.front.OrderRedis;
import cn.zmall.manager.pojo.TbMember;
import cn.zmall.manager.pojo.TbOrder;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;


/**
 * @Author cxy
 * @Date 2020/11/5 16:53
 * @Version 1.0
 */
@Service
public interface OrderService {

    /**
     * 创建订单
     *
     * @param orderDto
     * @return
     */
    Long placeOrder(OrderDto orderDto);

    /**
     * 查询单个订单
     *
     * @param orderId
     * @return
     */
    OrderList getOrder(Long orderId);

    /**
     * 取消订单
     *
     * @param orderId
     * @return
     */
    int cancleOrder(Long orderId);

    /**
     * 删除订单
     *
     * @param orderId
     * @return
     */
    int deleteOrder(Long orderId);

    /**
     * 删除购物记录
     *
     * @param orderId
     * @return
     */
    int deleteOrderShopping(Long orderId);

    /**
     * 支付订单
     *
     * @param tbThanks
     * @return
     */
    int payOrder(ThanksDto tbThanks);

    /**
     * 用户充值
     *
     * @param userId
     * @param money
     * @return
     */
    int UserCharge(Long userId, BigDecimal money);

    /**
     * 获取用户所有订单信息
     * @param userId
     * @return
     */
    List<TbOrder> getUserOrderList(Long userId);

    /**
     * redis 获取用户未支付的订单
     * @param userId
     * @return
     */
    OrderRedis getUserUnpayment(Long userId);

    /**
     * 获取用户已支付的订单
     * @param userId
     * @return
     */
    List<TbOrder> getAccountPaid(Long userId);

    /**
     * 获取不同状态的订单
     * @param userId
     * @param status
     * @return
     */
    List<TbOrder> getOrderByStatus(Long userId,Integer status);
}
